package a;

import java.util.Set;
import redis.clients.jedis.Jedis;

public class connect {

	public static void main(String[] args) {
		  Jedis jedis = new Jedis("127.0.0.1",6379);
		  String result = jedis.ping();
		  System.out.println(result);
		//设置值
		  //jedis.set("a", "abc");
		//获取值
		  //jedis.set("a", "张三");
		  //String a = jedis.get("a");
		  //System.out.println(a);
		//例子
		  Set<String> sets = jedis.keys("*");
		  System.out.println(sets.size());
		  jedis.close();
		 }

}
